package com.psytech.app.task.tasks_mds.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.NotNull;

@Entity
@Table(name = "comment")
public class EntityComment implements Serializable, STMEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7990713566211017204L;

	@Id
	@NotNull
	private String uid;

	@NotNull
	private String text;

	@NotNull
	@Temporal(value = TemporalType.TIMESTAMP)
	private Date creationDate;

	@ManyToOne(targetEntity = EntityTask.class)
	@JoinColumn(name = "taskUid")
	private EntityTask task;

	@NotNull
	private String writerUid;

	/**
	 * A définir par la couche métier.
	 * 
	 * @param uid
	 *            Universal ID de la tâche.
	 */
	public String getUid() {
		return uid;
	}

	public void setUid(final String uid) {
		this.uid = uid;
	}

	public String getText() {
		return text;
	}

	public void setText(final String text) {
		this.text = text;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(final Date creationDate) {
		this.creationDate = creationDate;
	}

	public EntityTask getTask() {
		return task;
	}

	public void setTask(final EntityTask task) {
		this.task = task;
	}

	public String getWriterUid() {
		return writerUid;
	}

	public void setWriterUid(final String writerUid) {
		this.writerUid = writerUid;
	}
}
